package com.xhwl.logistics.converter;

import com.xhwl.logistics.bo.VehiclePayRecordStatisticsBO;
import com.xhwl.logistics.bo.VehiclePayRecordStatisticsDateBO;
import com.xhwl.logistics.vo.VehiclePayRecordStatisticsVO;
import org.springframework.stereotype.Component;

import java.util.stream.Collectors;

@Component
public class ToVehiclePayRecordStatisticsVO {

    public VehiclePayRecordStatisticsVO toVehiclePayRecordStatisticsVO(VehiclePayRecordStatisticsBO vehiclePayRecordStatisticsBO) {
        VehiclePayRecordStatisticsVO vehiclePayRecordStatisticsVO = new VehiclePayRecordStatisticsVO();

        vehiclePayRecordStatisticsVO.setParkingLotName(vehiclePayRecordStatisticsBO.getParkingLotName());

        vehiclePayRecordStatisticsVO.setPay(vehiclePayRecordStatisticsBO.getPay().stream().map(VehiclePayRecordStatisticsDateBO::toVehicleStatisticsDateVO).collect(Collectors.toList()));

        return vehiclePayRecordStatisticsVO;
    }

}
